package Demo;

public class Stud {
    private String name;

    public Stud( String name) {
        this.name = name;
    }

    @Override
    public int hashCode() {
        if(this.name.equals("q")){
        return 1;}
        else {
            return 2;
        }
    }

    @Override
    public boolean equals(Object obj) {
        Stud stud = (Stud)obj;
        if(name.equals(stud.name)) {
            return true;
        }
        return false;
    }
}
